package grape.common.rest.mvc;

import java.util.List;
import java.util.stream.Collectors;

/**
 * Created by yangwei
 * Created at 2019/8/21 21:17
 */
public interface WebMapper<Vo,Po> extends BaseWebMapper {
    /**
     * 单表po转vo
     * @param po
     * @return
     */
    Vo poToVo(Po po);

    default List<Vo> posToVos(List<Po> pos) {
        return pos.stream().map(po->(poToVo(po))).collect(Collectors.toList());
    }
}
